using System.Collections;
using System.Collections.Generic;
using System.Web.Core;
using System;

namespace Yuanlin.Business
{
    public class YuanlinUserRequest : UserRequest
    {
        public YuanlinUserRequest()
        {
            int? entityId = GetParameterValue<int?>(YuanlinParameterName.UserId);
            if (entityId.HasValue)
            {
                EntityId = entityId.Value;
            }
        }
    }
    public class YuanlinUserListRequest : TEntityListRequest<YuanlinUser>
    {
        private string companyName = GetParameterValue<string>(YuanlinParameterName.CompanyName);
        private string companyType = GetParameterValue<string>(YuanlinParameterName.CompanyType);
        private int area = GetParameterValue<int>(YuanlinParameterName.Area);
        private int level = GetParameterValue<int>(YuanlinParameterName.Level);
        private string mobilePhoneKey = GetParameterValue<string>(YuanlinParameterName.MobilePhoneKey);
        private int provinceId = GetParameterValue<int>(YuanlinParameterName.ProvinceId);
        private int cityId = GetParameterValue<int>(YuanlinParameterName.CityId);
        private int townId = GetParameterValue<int>(YuanlinParameterName.TownId);
        private int smallTownId = GetParameterValue<int>(YuanlinParameterName.SmallTownId);
        private Guid memberId;

        public string CompanyName
        {
            get
            {
                if (!string.IsNullOrEmpty(companyName))
                {
                    return string.Format("%{0}%", companyName);
                }
                return "";
            }
            set
            {
                companyName = value;
            }
        }
        public string CompanyType
        {
            get
            {
                if (!string.IsNullOrEmpty(companyType))
                {
                    return string.Format("%,{0},%", companyType);
                }
                return "";
            }
            set
            {
                companyType = value;
            }
        }
        public int AreaId
        {
            get
            {
                return area;
            }
            set
            {
                area = value;
            }
        }
        public int AreaLevel
        {
            get
            {
                return level;
            }
            set
            {
                level = value;
            }
        }
        public string MobilePhoneKey
        {
            get
            {
                if (!string.IsNullOrEmpty(mobilePhoneKey))
                {
                    return string.Format("%{0}%", mobilePhoneKey);
                }
                return "";
            }
            set
            {
                mobilePhoneKey = value;
            }
        }
        public int ProvinceId
        {
            get
            {
                return provinceId;
            }
            set
            {
                provinceId = value;
            }
        }
        public int CityId
        {
            get
            {
                return cityId;
            }
            set
            {
                cityId = value;
            }
        }
        public int TownId
        {
            get
            {
                return townId;
            }
            set
            {
                townId = value;
            }
        }
        public int SmallTownId
        {
            get
            {
                return smallTownId;
            }
            set
            {
                smallTownId = value;
            }
        }
        public Guid MemberId
        {
            get
            {
                return memberId;
            }
            set
            {
                memberId = value;
            }
        }
    }
    public class YuanlinUserReply : UserReply
    {
    }
}
